package com.wkbb.basic.thread;

import com.wkbb.basic.feign.TcCloudFeignService;
import com.wkbb.basic.service.UserOpenService;
import com.wkbb.common.dto.im.GroupUserInfoDto;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * @author dengjingyuan
 * @date 2019-11-19 17:44
 */
@Slf4j
public class ImRepairImAccountTask implements Runnable {


    private TcCloudFeignService tcCloudFeignService;

    private List<GroupUserInfoDto> groupUserInfoDtoList;

    public ImRepairImAccountTask(TcCloudFeignService tcCloudFeignService, List<GroupUserInfoDto> groupUserInfoDtoList) {
        this.tcCloudFeignService = tcCloudFeignService;
        this.groupUserInfoDtoList = groupUserInfoDtoList;
    }

    public ImRepairImAccountTask() {

    }

    @Override
    public void run() {
        log.info("*********ImRepairImAccountTask********tcCloudFeignService:{},groupUserInfoDtoList:{}", tcCloudFeignService,groupUserInfoDtoList);
        try {

            log.info("----------准备开启自动修复IM账号--------orgId-{},userOpenService-{}",tcCloudFeignService,groupUserInfoDtoList);

            tcCloudFeignService.getCheckImAccountList(groupUserInfoDtoList);
        } catch (Exception e) {
            log.error("*******ImRepairImAccountTask**********", e);
        }
    }
}
